package org.urchr.beorganized.mobile.base.components.link;

import org.apache.wicket.Component;
import org.apache.wicket.behavior.SimpleAttributeModifier;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.image.Image;
import org.apache.wicket.markup.html.link.Link;
import org.apache.wicket.markup.html.panel.Panel;
import org.urchr.beorganized.mobile.base.Application;

public class MobileLink extends Panel{

	
	private static final long serialVersionUID = -499233365814090894L;

	public MobileLink(String id, String img, Link link, String text) {
		this(id, img, null, link, text);
	}
	
	public MobileLink(String id, String img, String img2, Link link, String text) {
		super(id);
		add(new Image("img").add(new SimpleAttributeModifier("src", Application.IMG_PREFIX+img)));
		if(img2==null || "".equals(img2))
			add(new Label("img2").setVisible(false));
		else
			add(new Image("img2").add(new SimpleAttributeModifier("src", Application.IMG_PREFIX+img2)));
		add(link);
		link.add(new Label("atext", text));
	}

}
